package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-15
 */
public class ButtonText implements Sequenceable, Serializable {
    @SerializedName("runs")
    private List<RunsItem> runs;

    public static final Sequenceable.Producer<ButtonText> CREATOR = new Producer<ButtonText>() {
        @Override
        public ButtonText createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ButtonText buttonText = new ButtonText();
            buttonText.unmarshalling(parcel);
            return buttonText;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeList(this.runs);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.runs = parcel.readSequenceableList(RunsItem.class);
        return true;
    }

    @Override
    public String toString() {
        return "ButtonText{" +
                "runs = '" + runs + '\'' +
                "}";
    }

    public List<RunsItem> getRuns() {
        return runs;
    }

    public void setRuns(List<RunsItem> runs) {
        this.runs = runs;
    }
}
